import React, { Component, createContext, PureComponent } from 'react'


class Home extends PureComponent {
  // 即将渲染获取时间
  componentWillMount() {
    this.beginTime = Date.now()
  }

  render() {

    return (
      <h2>Home:</h2>
    )

  }
  // 渲染完成获取时间
  componentDidMount() {
    this.endTime = Date.now()
    const interval = this.endTime - this.beginTime
    console.log("Home渲染时间", interval)
  }
}

class About extends PureComponent {
  render() {
    return <h2>About:</h2>
  }
}

// const EnhanceAbout = enhanceRegionProps(About)

class App extends Component {
  render() {
    return (
      <div>
        App:
        <Home />
        <About />
      </div>
    )
  }
}

export default App
